﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbMText : OdDbEntity
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbMText(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbMText_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbMText obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbMText()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbMText(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbMText cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbMText_cast(OdRxObject.getCPtr(pObj));
			OdDbMText result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbMText)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbMText)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbMText)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbMText_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbMText_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbMText_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbMText createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbMText_createObject();
			OdDbMText result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbMText)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbMText)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbMText)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d location()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbMText_location(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setLocation(OdGePoint3d location)
		{
			TD_DbPINVOKE.OdDbMText_setLocation(this.swigCPtr, OdGePoint3d.getCPtr(location));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeVector3d normal()
		{
			OdGeVector3d result = new OdGeVector3d(TD_DbPINVOKE.OdDbMText_normal(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setNormal(OdGeVector3d normal)
		{
			TD_DbPINVOKE.OdDbMText_setNormal(this.swigCPtr, OdGeVector3d.getCPtr(normal));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeVector3d direction()
		{
			OdGeVector3d result = new OdGeVector3d(TD_DbPINVOKE.OdDbMText_direction(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDirection(OdGeVector3d direction)
		{
			TD_DbPINVOKE.OdDbMText_setDirection(this.swigCPtr, OdGeVector3d.getCPtr(direction));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double rotation()
		{
			double result = TD_DbPINVOKE.OdDbMText_rotation(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setRotation(double rotation)
		{
			TD_DbPINVOKE.OdDbMText_setRotation(this.swigCPtr, rotation);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double width()
		{
			double result = TD_DbPINVOKE.OdDbMText_width(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setWidth(double width)
		{
			TD_DbPINVOKE.OdDbMText_setWidth(this.swigCPtr, width);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbObjectId textStyle()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr cPtr = TD_DbPINVOKE.OdDbMText_textStyle(this.swigCPtr);
			OdDbObjectId result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(new OdDbObjectId(cPtr, true));
				result = new OdDbObjectId(cPtr, false);
			}
			else
			{
				result = new OdDbObjectId(cPtr, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setTextStyle(OdDbObjectId textStyleId)
		{
			TD_DbPINVOKE.OdDbMText_setTextStyle(this.swigCPtr, OdDbObjectId.getCPtr(textStyleId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double textHeight()
		{
			double result = TD_DbPINVOKE.OdDbMText_textHeight(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setTextHeight(double height)
		{
			TD_DbPINVOKE.OdDbMText_setTextHeight(this.swigCPtr, height);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbMText.AttachmentPoint attachment()
		{
			OdDbMText.AttachmentPoint result = (OdDbMText.AttachmentPoint)TD_DbPINVOKE.OdDbMText_attachment(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAttachment(OdDbMText.AttachmentPoint type)
		{
			TD_DbPINVOKE.OdDbMText_setAttachment(this.swigCPtr, (int)type);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbMText.FlowDirection flowDirection()
		{
			OdDbMText.FlowDirection result = (OdDbMText.FlowDirection)TD_DbPINVOKE.OdDbMText_flowDirection(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setFlowDirection(OdDbMText.FlowDirection flowDirection)
		{
			TD_DbPINVOKE.OdDbMText_setFlowDirection(this.swigCPtr, (int)flowDirection);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public string contents()
		{
			string result = TD_DbPINVOKE.OdDbMText_contents(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int setContents(string text)
		{
			int result = TD_DbPINVOKE.OdDbMText_setContents(this.swigCPtr, text);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int setContentsRTF(string text)
		{
			int result = TD_DbPINVOKE.OdDbMText_setContentsRTF(this.swigCPtr, text);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double actualWidth()
		{
			double result = TD_DbPINVOKE.OdDbMText_actualWidth(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string nonBreakSpace()
		{
			string result = TD_DbPINVOKE.OdDbMText_nonBreakSpace();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string overlineOn()
		{
			string result = TD_DbPINVOKE.OdDbMText_overlineOn();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string overlineOff()
		{
			string result = TD_DbPINVOKE.OdDbMText_overlineOff();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string underlineOn()
		{
			string result = TD_DbPINVOKE.OdDbMText_underlineOn();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string underlineOff()
		{
			string result = TD_DbPINVOKE.OdDbMText_underlineOff();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string colorChange()
		{
			string result = TD_DbPINVOKE.OdDbMText_colorChange();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string fontChange()
		{
			string result = TD_DbPINVOKE.OdDbMText_fontChange();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string heightChange()
		{
			string result = TD_DbPINVOKE.OdDbMText_heightChange();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string widthChange()
		{
			string result = TD_DbPINVOKE.OdDbMText_widthChange();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string obliqueChange()
		{
			string result = TD_DbPINVOKE.OdDbMText_obliqueChange();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string trackChange()
		{
			string result = TD_DbPINVOKE.OdDbMText_trackChange();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string lineBreak()
		{
			string result = TD_DbPINVOKE.OdDbMText_lineBreak();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string paragraphBreak()
		{
			string result = TD_DbPINVOKE.OdDbMText_paragraphBreak();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string stackStart()
		{
			string result = TD_DbPINVOKE.OdDbMText_stackStart();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string alignChange()
		{
			string result = TD_DbPINVOKE.OdDbMText_alignChange();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string blockBegin()
		{
			string result = TD_DbPINVOKE.OdDbMText_blockBegin();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static string blockEnd()
		{
			string result = TD_DbPINVOKE.OdDbMText_blockEnd();
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setLineSpacingStyle(LineSpacingStyle lineSpacingStyle)
		{
			TD_DbPINVOKE.OdDbMText_setLineSpacingStyle(this.swigCPtr, (int)lineSpacingStyle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public LineSpacingStyle lineSpacingStyle()
		{
			LineSpacingStyle result = (LineSpacingStyle)TD_DbPINVOKE.OdDbMText_lineSpacingStyle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setLineSpacingFactor(double lineSpacingFactor)
		{
			TD_DbPINVOKE.OdDbMText_setLineSpacingFactor(this.swigCPtr, lineSpacingFactor);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double lineSpacingFactor()
		{
			double result = TD_DbPINVOKE.OdDbMText_lineSpacingFactor(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public TextHorzMode horizontalMode()
		{
			TextHorzMode result = (TextHorzMode)TD_DbPINVOKE.OdDbMText_horizontalMode(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setHorizontalMode(TextHorzMode horizontalMode)
		{
			TD_DbPINVOKE.OdDbMText_setHorizontalMode(this.swigCPtr, (int)horizontalMode);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public TextVertMode verticalMode()
		{
			TextVertMode result = (TextVertMode)TD_DbPINVOKE.OdDbMText_verticalMode(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setVerticalMode(TextVertMode verticalMode)
		{
			TD_DbPINVOKE.OdDbMText_setVerticalMode(this.swigCPtr, (int)verticalMode);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdGeMatrix3d getEcs()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(TD_DbPINVOKE.OdDbMText_getEcs(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult dwgInFields(OdDbDwgFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbMText_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbMText_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual bool subWorldDraw(OdGiWorldDraw pWd)
		{
			bool result = TD_DbPINVOKE.OdDbMText_subWorldDraw(this.swigCPtr, OdGiWorldDraw.getCPtr(pWd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void subViewportDraw(OdGiViewportDraw pVd)
		{
			TD_DbPINVOKE.OdDbMText_subViewportDraw(this.swigCPtr, OdGiViewportDraw.getCPtr(pVd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult subTransformBy(OdGeMatrix3d xfm)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_subTransformBy(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subExplode(OdRxObjectPtrArray entitySet)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_subExplode(this.swigCPtr, OdRxObjectPtrArray.getCPtr(entitySet));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult explodeGeometry(OdRxObjectPtrArray entitySet)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_explodeGeometry(this.swigCPtr, OdRxObjectPtrArray.getCPtr(entitySet));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetClassID(IntPtr pClsid)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_subGetClassID(this.swigCPtr, pClsid);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void subClose()
		{
			TD_DbPINVOKE.OdDbMText_subClose(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void explodeFragments(OdDbMTextEnumDelegate fragmentFn, IntPtr arg1, OdGiWorldDraw ctxt)
		{
			TD_DbPINVOKE.OdDbMText_explodeFragments__SWIG_0(this.swigCPtr, fragmentFn, arg1, OdGiWorldDraw.getCPtr(ctxt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void explodeFragments(OdDbMTextEnumDelegate fragmentFn, IntPtr arg1)
		{
			TD_DbPINVOKE.OdDbMText_explodeFragments__SWIG_1(this.swigCPtr, fragmentFn, arg1);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double actualHeight(OdGiWorldDraw ctxt)
		{
			double result = TD_DbPINVOKE.OdDbMText_actualHeight__SWIG_0(this.swigCPtr, OdGiWorldDraw.getCPtr(ctxt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double actualHeight()
		{
			double result = TD_DbPINVOKE.OdDbMText_actualHeight__SWIG_1(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getActualBoundingPoints(OdGePoint3dArray boundingPoints, double dGapX, double dGapY)
		{
			TD_DbPINVOKE.OdDbMText_getActualBoundingPoints__SWIG_0(this.swigCPtr, OdGePoint3dArray.getCPtr(boundingPoints), dGapX, dGapY);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getActualBoundingPoints(OdGePoint3dArray boundingPoints, double dGapX)
		{
			TD_DbPINVOKE.OdDbMText_getActualBoundingPoints__SWIG_1(this.swigCPtr, OdGePoint3dArray.getCPtr(boundingPoints), dGapX);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getActualBoundingPoints(OdGePoint3dArray boundingPoints)
		{
			TD_DbPINVOKE.OdDbMText_getActualBoundingPoints__SWIG_2(this.swigCPtr, OdGePoint3dArray.getCPtr(boundingPoints));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getBoundingPoints(OdGePoint3dArray boundingPoints)
		{
			TD_DbPINVOKE.OdDbMText_getBoundingPoints(this.swigCPtr, OdGePoint3dArray.getCPtr(boundingPoints));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdResult setAttachmentMovingLocation(OdDbMText.AttachmentPoint attachment)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_setAttachmentMovingLocation(this.swigCPtr, (int)attachment);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetGeomExtents(OdGeExtents3d extents)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_subGetGeomExtents(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool backgroundFillOn()
		{
			bool result = TD_DbPINVOKE.OdDbMText_backgroundFillOn(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBackgroundFill(bool bEnable)
		{
			TD_DbPINVOKE.OdDbMText_setBackgroundFill(this.swigCPtr, bEnable);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdCmColor getBackgroundFillColor()
		{
			OdCmColor result = new OdCmColor(TD_DbPINVOKE.OdDbMText_getBackgroundFillColor(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBackgroundFillColor(OdCmColor color)
		{
			TD_DbPINVOKE.OdDbMText_setBackgroundFillColor(this.swigCPtr, OdCmColor.getCPtr(color));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double getBackgroundScaleFactor()
		{
			double result = TD_DbPINVOKE.OdDbMText_getBackgroundScaleFactor(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBackgroundScaleFactor(double scaleFactor)
		{
			TD_DbPINVOKE.OdDbMText_setBackgroundScaleFactor(this.swigCPtr, scaleFactor);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdCmTransparency getBackgroundTransparency()
		{
			OdCmTransparency result = new OdCmTransparency(TD_DbPINVOKE.OdDbMText_getBackgroundTransparency(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBackgroundTransparency(OdCmTransparency transparency)
		{
			TD_DbPINVOKE.OdDbMText_setBackgroundTransparency(this.swigCPtr, OdCmTransparency.getCPtr(transparency));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool useBackgroundColorOn()
		{
			bool result = TD_DbPINVOKE.OdDbMText_useBackgroundColorOn(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setUseBackgroundColor(bool enable)
		{
			TD_DbPINVOKE.OdDbMText_setUseBackgroundColor(this.swigCPtr, enable);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getParagraphsIndent(OdDbMTextIndents indents)
		{
			TD_DbPINVOKE.OdDbMText_getParagraphsIndent(this.swigCPtr, OdDbMTextIndents.getCPtr(indents));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdDbObjectId setField(string fieldName, OdDbField pField)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr cPtr = TD_DbPINVOKE.OdDbMText_setField(this.swigCPtr, fieldName, OdDbField.getCPtr(pField));
			OdDbObjectId result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(new OdDbObjectId(cPtr, true));
				result = new OdDbObjectId(cPtr, false);
			}
			else
			{
				result = new OdDbObjectId(cPtr, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult removeField(OdDbObjectId fieldId)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_removeField__SWIG_0(this.swigCPtr, OdDbObjectId.getCPtr(fieldId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdDbObjectId removeField(string fieldName)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr cPtr = TD_DbPINVOKE.OdDbMText_removeField__SWIG_1(this.swigCPtr, fieldName);
			OdDbObjectId result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(new OdDbObjectId(cPtr, true));
				result = new OdDbObjectId(cPtr, false);
			}
			else
			{
				result = new OdDbObjectId(cPtr, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void convertFieldToText()
		{
			TD_DbPINVOKE.OdDbMText_convertFieldToText(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void subSetDatabaseDefaults(OdDbDatabase pDb, bool doSubents)
		{
			TD_DbPINVOKE.OdDbMText_subSetDatabaseDefaults(this.swigCPtr, OdDbDatabase.getCPtr(pDb), doSubents);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setDynamicColumns(double width, double gutter, bool bAutoHeigh)
		{
			TD_DbPINVOKE.OdDbMText_setDynamicColumns(this.swigCPtr, width, gutter, bAutoHeigh);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setStaticColumns(double width, double gutter, short count)
		{
			TD_DbPINVOKE.OdDbMText_setStaticColumns(this.swigCPtr, width, gutter, count);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbMText.ColumnType getColumnType()
		{
			OdDbMText.ColumnType result = (OdDbMText.ColumnType)TD_DbPINVOKE.OdDbMText_getColumnType(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setColumnType(OdDbMText.ColumnType colType)
		{
			TD_DbPINVOKE.OdDbMText_setColumnType(this.swigCPtr, (int)colType);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool getColumnAutoHeight()
		{
			bool result = TD_DbPINVOKE.OdDbMText_getColumnAutoHeight(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setColumnAutoHeight(bool bAutoHeigh)
		{
			TD_DbPINVOKE.OdDbMText_setColumnAutoHeight(this.swigCPtr, bAutoHeigh);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int getColumnCount()
		{
			int result = TD_DbPINVOKE.OdDbMText_getColumnCount(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setColumnCount(int numCol)
		{
			TD_DbPINVOKE.OdDbMText_setColumnCount(this.swigCPtr, numCol);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double getColumnWidth()
		{
			double result = TD_DbPINVOKE.OdDbMText_getColumnWidth(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setColumnWidth(double colWidth)
		{
			TD_DbPINVOKE.OdDbMText_setColumnWidth(this.swigCPtr, colWidth);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double getColumnGutterWidth()
		{
			double result = TD_DbPINVOKE.OdDbMText_getColumnGutterWidth(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setColumnGutterWidth(double colGutter)
		{
			TD_DbPINVOKE.OdDbMText_setColumnGutterWidth(this.swigCPtr, colGutter);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool getColumnFlowReversed()
		{
			bool result = TD_DbPINVOKE.OdDbMText_getColumnFlowReversed(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setColumnFlowReversed(bool bFlowRev)
		{
			TD_DbPINVOKE.OdDbMText_setColumnFlowReversed(this.swigCPtr, bFlowRev);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double getColumnHeight(short col)
		{
			double result = TD_DbPINVOKE.OdDbMText_getColumnHeight(this.swigCPtr, col);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setColumnHeight(short col, double colHeight)
		{
			TD_DbPINVOKE.OdDbMText_setColumnHeight(this.swigCPtr, col, colHeight);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double height()
		{
			double result = TD_DbPINVOKE.OdDbMText_height(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setHeight(double value)
		{
			TD_DbPINVOKE.OdDbMText_setHeight(this.swigCPtr, value);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult getPlane(OdGePlane plane, out Planarity planarity)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbMText_getPlane(this.swigCPtr, OdGePlane.getCPtr(plane), out planarity);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetTransformedCopy(OdGeMatrix3d mat, out OdDbEntity pCopy)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDbMText_subGetTransformedCopy(this.swigCPtr, OdGeMatrix3d.getCPtr(mat), out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				pCopy = (OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public double ascent()
		{
			double result = TD_DbPINVOKE.OdDbMText_ascent(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double descent()
		{
			double result = TD_DbPINVOKE.OdDbMText_descent(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setShowBorders(bool bEnable)
		{
			TD_DbPINVOKE.OdDbMText_setShowBorders(this.swigCPtr, bEnable);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool showBorders()
		{
			bool result = TD_DbPINVOKE.OdDbMText_showBorders(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum AttachmentPoint
		{
			kTopLeft = 1,
			kTopCenter,
			kTopRight,
			kMiddleLeft,
			kMiddleCenter,
			kMiddleRight,
			kBottomLeft,
			kBottomCenter,
			kBottomRight,
			kBaseLeft,
			kBaseCenter,
			kBaseRight,
			kBaseAlign,
			kBottomAlign,
			kMiddleAlign,
			kTopAlign,
			kBaseFit,
			kBottomFit,
			kMiddleFit,
			kTopFit,
			kBaseMid,
			kBottomMid,
			kMiddleMid,
			kTopMid
		}

		public enum FlowDirection
		{
			kLtoR = 1,
			kRtoL,
			kTtoB,
			kBtoT,
			kByStyle
		}

		public enum ColumnType
		{
			kNoColumns,
			kStaticColumns,
			kDynamicColumns
		}
	}
}
